Eclipse Platform
Pre-release 3.0

org.eclipse.team.core.sync
Interface ILocalSyncElement

All Known Subinterfaces:
IRemoteSyncElement
All Known Implementing Classes:
LocalSyncElement, RemoteSyncElement

public interface ILocalSyncElement

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves. A ILocalSyncElement describes the relative synchronization of a local resource using a base resource for comparison.

Differences between the base and local resources are classified as outgoing changes; if there is a difference, the local resource is considered the outgoing resource.

Since:
2.0
See Also:
IRemoteSyncElement

Field Summary
static int ADDITION
          Sync constant (value 1) indicating that one side was added.
static int AUTOMERGE_CONFLICT
          Sync constant (value 32) indicating that both the local and remote resources have changed relative to the base but their content changes do not conflict (e.g.
static int CHANGE
          Sync constant (value 3) indicating that one side was changed.
static int CHANGE_MASK
          Bit mask for extracting the change type.
static int CONFLICTING
          Sync constant (value 12) indicating a change to both the remote and local resources.
static int DELETION
          Sync constant (value 2) indicating that one side was deleted.
static int DIRECTION_MASK
          Bit mask for extracting the synchronization direction.
static int GRANULARITY_CONTENTS
          Constant (value 2) indicating to consider file contents when calculating the synchronization kind.
static int GRANULARITY_CONTENTS_IGNORE_WHITESPACE
          Constant (value 4) indicating to consider file contents (potentially ignoring whitespace) when calculating the synchronization kind.
static int GRANULARITY_TIMESTAMP
          Constant (value 1) to only consider timestamp comparisons (e.g.
static int IN_SYNC
          Sync constant (value 0) indicating element is in sync.
static int INCOMING
          Sync constant (value 8) indicating a change to the remote resource.
static int MANUAL_CONFLICT
          Sync constant (value 64) indicating that both the local and remote resources have changed relative to the base and their content changes conflict (e.g.
static int OUTGOING
          Sync constant (value 4) indicating a change to the local resource.
static int PSEUDO_CONFLICT
          Sync constant (value 16) indication that both the local and remote resources have changed relative to the base but their contents are the same.
 
Method Summary
 IRemoteResource getBase()
          Answers the base sync element of this node.
 IResource getLocal()
          Answers the local sync element of this node.
 String getName()
          Answer a string that describes the simple name of the sync node, which is suitable for display to a user.
 int getSyncKind(int granularity, IProgressMonitor progress)
          Performs a synchronization calculation on the given element based on the local and base resources.
 boolean isContainer()
          Answer if the sync node is a container and may have children.
 ILocalSyncElement[] members(IProgressMonitor monitor)
          Answers and array of ILocalSyncElement elements that are immediate children of this sync element, in no particular order.
 

Field Detail

IN_SYNC

public static final int IN_SYNC
Sync constant (value 0) indicating element is in sync.

See Also:
Constant Field Values

ADDITION

public static final int ADDITION
Sync constant (value 1) indicating that one side was added.

See Also:
Constant Field Values

DELETION

public static final int DELETION
Sync constant (value 2) indicating that one side was deleted.

See Also:
Constant Field Values

CHANGE

public static final int CHANGE
Sync constant (value 3) indicating that one side was changed.

See Also:
Constant Field Values

CHANGE_MASK

public static final int CHANGE_MASK
Bit mask for extracting the change type.

See Also:
Constant Field Values

OUTGOING

public static final int OUTGOING
Sync constant (value 4) indicating a change to the local resource.

See Also:
Constant Field Values

INCOMING

public static final int INCOMING
Sync constant (value 8) indicating a change to the remote resource.

See Also:
Constant Field Values

CONFLICTING

public static final int CONFLICTING
Sync constant (value 12) indicating a change to both the remote and local resources.

See Also:
Constant Field Values

DIRECTION_MASK

public static final int DIRECTION_MASK
Bit mask for extracting the synchronization direction.

See Also:
Constant Field Values

PSEUDO_CONFLICT

public static final int PSEUDO_CONFLICT
Sync constant (value 16) indication that both the local and remote resources have changed relative to the base but their contents are the same.

See Also:
Constant Field Values

AUTOMERGE_CONFLICT

public static final int AUTOMERGE_CONFLICT
Sync constant (value 32) indicating that both the local and remote resources have changed relative to the base but their content changes do not conflict (e.g. source file changes on different lines). These conflicts could be merged automatically.

See Also:
Constant Field Values

MANUAL_CONFLICT

public static final int MANUAL_CONFLICT
Sync constant (value 64) indicating that both the local and remote resources have changed relative to the base and their content changes conflict (e.g. local and remote resource have changes on same lines). These conflicts can only be correctly resolved by the user.

See Also:
Constant Field Values

GRANULARITY_TIMESTAMP

public static final int GRANULARITY_TIMESTAMP
Constant (value 1) to only consider timestamp comparisons (e.g. isDirty) when calculating the synchronization kind. This is the faster sync compare option but it can result in false conflicts.

See Also:
Constant Field Values

GRANULARITY_CONTENTS

public static final int GRANULARITY_CONTENTS
Constant (value 2) indicating to consider file contents when calculating the synchronization kind. This synchronization mode will perform a content comparison only after timestamp operations (isDirty) indicate a change. This mode allows conflicts types to be correctly identified.

See Also:
Constant Field Values

GRANULARITY_CONTENTS_IGNORE_WHITESPACE

public static final int GRANULARITY_CONTENTS_IGNORE_WHITESPACE
Constant (value 4) indicating to consider file contents (potentially ignoring whitespace) when calculating the synchronization kind. This synchronization mode will perform a content comparison only after timestamp operations (isDirty) indicate a change. This mode allows conflicts types to be correctly identified.

See Also:
Constant Field Values
Method Detail

getName

public String getName()
Answer a string that describes the simple name of the sync node, which is suitable for display to a user. The name will be used in UI operations, so it is expected that implementations will cache this value.

Returns:
String the simple name that identifies the resource within its parent container.

isContainer

public boolean isContainer()
Answer if the sync node is a container and may have children.

Returns:
boolean true if the remote resource is a container, and false if it is not.

getLocal

public IResource getLocal()
Answers the local sync element of this node. Returns a non-existing local resource handle if the local resource does not exist in the workspace.

Returns:
IResource the local resource handle in this node. There should always be a local resource available, however the resource may not exist.

getBase

public IRemoteResource getBase()
Answers the base sync element of this node. Returns null if there is no base (e.g. conflicting add).

Returns:
IRemoteResource the base resource in this node, or null is there is none.

members

public ILocalSyncElement[] members(IProgressMonitor monitor)
                            throws TeamException
Answers and array of ILocalSyncElement elements that are immediate children of this sync element, in no particular order. The returned sync nodes are a combination of the nodes represented by the sync element (e.g. local, base, remote).

Parameters:
monitor - a progress monitor to indicate the duration of the operation, or null if progress reporting is not required.
Returns:
ILocalSyncElement[] array of immediate children of this sync node.
Throws:
TeamException

getSyncKind

public int getSyncKind(int granularity,
                       IProgressMonitor progress)
Performs a synchronization calculation on the given element based on the local and base resources. Returns an integer describing the synchronization state of this element.

Parameters:
granularity - the granularity at which the elements of this sync element should be compared. On of GRANULARITY_TIMESTAMP, or GRANULARITY_CONTENTS.
progress - a progress monitor to indicate the duration of the operation, or null if progress reporting is not required.
Returns:
int an integer describing the synchronization state of this element.

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.